﻿// =============================================================================
// XPathDebugger And Examples CashFlowReport.cs
// Copyright (c) 2013 TNTTechnologies Inc.
// =============================================================================

#region

using System;
using System.Collections.Generic;
using System.Xml.Serialization;

#endregion

namespace Example{
    public class Car{
        public DateTime FactoryDate { get; set; }
        public string wheel { get; set; }
        public string brake { get; set; }
        public IPodConnector IPodConnector { get; set; }
        public Stereo Stereo { get; set; }
    }

    public class Stereo{
        public Screen Screen { get; set; }
        public string Make { get; set; }
        public string Watts { get; set; }
        public IPodConnector IPodConnector { get; set; }
    }

    public class IPodConnector{
        public string Version { get; set; }
    }

    public class Screen{
        public string Size { get; set; }
    }

    [Serializable]
    [XmlRoot("cashFlowReport")]
    public class CashFlowReport{
        private List<CashFlow> cashFlows = new List<CashFlow>();
        private List<SummaryCashFlow> summaryCashFlows = new List<SummaryCashFlow>();

        public Car MyCar { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("valuationDate")]
        public DateTime ValuationDate { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("portfolioName")]
        public String PorfolioName { get; set; }

        [XmlIgnore]
        public DateTime? CashFlowEndDate { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("portfolioDescription")]
        public String PortfolioDescription { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("portfolioCurrencyType")]
        public int PortfolioCurrencyType { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("portfolioFXRateGroupID")]
        public int PortfolioFXRateGroupID { get; set; }

        [XmlSerializerFormat]
        [XmlAttribute("portfolioCreatedDate")]
        public DateTime PortfolioCreatedDate { get; set; }

        [XmlArray("cashFlows")]
        [XmlArrayItem("cashFlow")]
        public List<CashFlow> CashFlows{
            get{
                return this.cashFlows;
            }
            set{
                this.cashFlows = value;
            }
        }

        [XmlArray("summaryCashFlows")]
        [XmlArrayItem("summaryCashFlow")]
        public List<SummaryCashFlow> SummaryCashFlows{
            get{
                return this.summaryCashFlows;
            }
            set{
                this.summaryCashFlows = value;
            }
        }
    }
}